﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="news_window_frame.aspx.cs" Inherits="Ccit.OA.NewsCenter.news_window_frame" %>
<%@ Register TagPrefix="ccit" Namespace="Ccit.ServerControls" Assembly="Ccit.ServerControls.ActionForm" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>信息中心-窗口设置</title>
    <script language="javascript" src="../script/jquery.js" type="text/javascript"></script>
    <script language="javascript" src="../script/StringClass_Ext.js" type="text/javascript"></script>
    <script language="javascript" src="../script/jsonlib.js" type="text/javascript"></script>
    <script language="javascript" src="../script/jcontrol.js" type="text/javascript"></script>
    <script language="javascript" src="../script/jwindow.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
      //保存
      function doSave(vOperSign){
          if(!checkNum()) return ;
          var QueryClause={};
          QueryClause.ClauseId = self.frames[1].document.getElementById("_hidClauseId").value;
          if(self.frames[1].getClauseContent()=="")
            return;
          QueryClause.ClauseContent = self.frames[1].getClauseContent();
          var jsonClause=JSON.stringify(QueryClause,function(key,value){return value;});
          
          var WinStyle={};
          WinStyle.PlateId=self.frames[0].document.getElementById("_hidPlateId").value;
          WinStyle.PlateName=self.frames[0].document.getElementById("txtPlateName").value;
          WinStyle.PlateLogo=self.frames[0].document.getElementById("_hidImgPath").value;
          WinStyle.TitleStyle=self.frames[0].document.getElementById("_hidBorderColor").value;
          WinStyle.ShowNum=self.frames[0].document.getElementById("txtShowNum").value;
          if(self.frames[0].document.getElementById("cbkShowDate").checked)
              WinStyle.ShowPubTime="1";
           else
              WinStyle.ShowPubTime="0";  
          if(self.frames[0].document.getElementById("cbkShowCreateor").checked)
              WinStyle.ShowCreateor="1";  
          else
              WinStyle.ShowCreateor="0";    
              
          var vType = document.getElementById("_hidType").value;
          var jsonWin=JSON.stringify(WinStyle,function(key,value){return value;});
          PageMethods.SaveWinClause(jsonWin,jsonClause,vOperSign,vType,ClientCallBack);
      }
      //验证
      function checkNum(){
          var showNum=self.frames[0].document.getElementById("txtShowNum").value;
          var winName=self.frames[0].document.getElementById("txtPlateName").value;
          if(winName == "")
          {
             alert("窗口名称不能为空");
             return false;
          }
          if(showNum!=""&&!showNum.IsNumber())
          {
             alert("显示数字必须填数字");
             return false;
          }
          return true;
       }
      function ClientCallBack(vResult){
         var vArray=vResult.split("_");
         eval("var vResultObj="+vArray[0]);
         if(vResultObj.resFlag > 0){
            alert(vResultObj.resMes);
         }
         if(vArray[1]=="1"){ //保存
            self.frames[0].document.getElementById("_hidPlateId").value=vResultObj.resPlateId;
            self.frames[1].document.getElementById("_hidClauseId").value=vResultObj.resPlateId;
         }
         
         var vPageParam = "Type="+document.getElementById("_hidType").value+"&TABID="+document.getElementById("_hidTabId").value;
		 var encodeParam = base64encode(vPageParam);
         
         if(vArray[1]=="2"){ //保存并新增
              document.location="news_window_frame.aspx?" + encodeParam;
            
         }
         if(vArray[1]=="3"){ //保存并返回
             document.location="news_window_list.aspx?" + encodeParam;
         }
      }
      //返回
      function back(){
         var vPageParam = "Type="+document.getElementById("_hidType").value+"&TABID="+document.getElementById("_hidTabId").value;
		 var encodeParam = base64encode(vPageParam);
         self.document.location="news_window_list.aspx?" + encodeParam;
      }
    </script>
</head>
<body>
    <ccit:ActionForm id="form1" runat="server">
      <input type="hidden" id="_hidTabId" runat="server" />
      
      <input type="hidden" id="_hidPlateId" value=""  runat="server"/>
      <input type="hidden" id="_hidType" value=""  runat="server"/>
      <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
      </asp:ScriptManager>
      <table class="tbToolbar" cellpadding="0" cellspacing="0" width="98%" align="center">
        <tr>
            <td align="left">
                <div class="tbSeparator">
                </div>
            </td>
            <td width="100%" class="titlebar">
                信息中心-信息窗口管理
            </td>
        </tr>
      </table>
      <table border="0" class="tableborder" cellpadding="0" cellspacing="0" style="width: 98%; height: 95%" align="center">       
          <tr>
              <td style="width: 36%; height: 300px; padding-left:10px; padding-top:0px" valign="top">
                  <iframe scrolling="auto" id="iFrmEditAttr" name="iFrmEditAttr" runat="server" width="100%" src="" height="100%" frameborder="0" ></iframe>
              </td>
              <td style="width: 64%; height: 300px" align="center" valign="top">
                  <iframe id="iFrmEditQuerySet" name="iFrmEditQuerySet" width="100%" runat="server" height="100%" src="" scrolling="auto" frameborder="0"></iframe>
              </td>
          </tr>
          <tr>
              <td class="pformstrip" colspan="2"  align="center" valign="top">
                  <input type="button" id="btnSave" class="button" value="保存" onclick="doSave('1')" />
                  &nbsp;
                  <input type="button" id="btnSaveCont" class="button" value="保存并新增" onclick="doSave('2')" />
                  &nbsp;
                  <input type="button" id="btnSaveBack" class="button" value="保存并返回" onclick="doSave('3')" />
                  &nbsp;
                  <input type="button" id="btnBack" class="button" value="返回" onclick="back()" />
              </td>
          </tr>
          <tr>
              <td colspan="2"  align="center" valign="top">
                  &nbsp;
              </td>
          </tr>
      </table>
    </ccit:ActionForm>
</body>
</html>
</form>
</body>
</html>
